1. Field of the Invention
The present invention relates in general to computer programs, and more particularly to providing assistance to a programmer creating computer program code.
2. Description of the Related Art
A code assist or content assist is a function which aids a programmer in writing a computer program statement by suggesting proposals or candidates for insertion into the computer program statement. The programmer may select one of the proposals or candidates in order to supplement, modify complete, or replace a computer program statement being edited.
Conventional code assist functions are exemplified by the Eclipse Project code assist function as described in the Eclipse Project Java Development User Guide, (c) Copyright IBM Corp. 2000, 2001, pages 9-12, http://www.eclipse.org/eclipse/index.html. The Eclipse Project code assist function provides a programmer with suggested assistance in writing Java code. The programmer may activate the Eclipse Project code assist function from a Java code editor on a line of Java computer program code which causes a scrollable list of available Java code completions to be displayed. The programmer may then select one of the proposed Java code completion candidates from the scrollable list to be inserted to complete the line of Java computer program code.
The programmer may also configure the behavior of the Eclipse Project code assist by selecting or specifying various preferences in a Code Assist tab within a Java Editor preference page. Color preferences allow the programmer to specify the colors used for the code assist window and the colors used when showing method parameters. An alphabetical sort preference, if enabled, causes proposals to be sorted in alphabetical order. A visibility preference limits displayed proposals in the list by Java visibility rules to only those proposals visible in a current invocation context. An argument name preference, if enabled, causes a selection of a Java method proposal to additionally insert the Java method's argument names as specified in the Java method's declaration. A qualified versus import name preference allows the programmer to select whether the code assist function inserts fully qualified names for type proposals or insets non-qualified names for type proposals in conjunction with an addition of the corresponding import declaration. A preference for automatic insertion of a single proposal when the proposal list only contains the single proposal may be specified. The user may also specify preferences as to the code assist function's activation behavior. An auto activation preference may specify that code assist is invoked automatically in response to specified character triggers after a specified time delay.
Even with these capabilities and user-specified preferences, conventional code assist functions still fail to provide adequate assistance for a programming language which allows a variation in valid syntax for a particular command or verb, a variation in keyword representations for a particular keyword, variations in valid argument types for a particular command or verb, or variations in style such as character case. In view of these possible variations, a user may prefer only one of the variations, or the use may prefer to be reminded of all of the possible variations.
In particular, these conventional code assist functions fail to provide adequate assistance for variable-syntax programming languages such as COBOL or PL/I having these complexities. Complex languages such as COBOL may have numerous variations in syntax for a single statement. For example, a COBOL GOTO statement has the syntax: “GO” [“TO”] procedure name, which gives rise to two format variations: “GO TO procedure-name” and “GO procedure-name”. The COBOL MOVE statement has the following syntax:
“MOVE” [CORRESPONDING|CORR] {identifier-1|literal-1} “TO” identifier-2 and has six format variations:
“MOVE CORRESPONDING identifier-1 TO identifier-2”
“MOVE CORRESPONDING literal-1 TO identifier-2”
“MOVE CORR identifier-1 TO identifier-2”
“MOVE CORR literal-1 TO identifier-2”
“MOVE identifier-1 TO identifier-2”
“MOVE literal-1 TO identifier-2”
In a complex language such as COBOL, keywords may have alternative spellings. For example, COBOL keywords may have the following alternative spellings: “CORRESPONDING” or “CORR”, “IDENTIFICATION” or “ID”, “JUSTIFIED” or “JUST”, “PICTURE” or “PIC”, “SYNCHRONIZED” or “SYNC”, and “THROUGH” or “THRU”. Alternatively, keywords or reserve words may be optional, such as the optional keyword “TO” in the above GOTO statement or the optional keyword CORRESPONDING in the above MOVE statement. Further complexities may result from keywords dictating a subsequent format of a statement, or from a format being recursive.
A programmer desiring an effective code assist function for such a complex programming language needs a code assist function which supports such complexity variations, supports user-specified preferences for such complexity variations, and which effectively provides suggested proposals for completing programming statements having such complexity variations. However, conventional code assist functions fail to provide this. Thus, there is a clearly felt need for an improved code assist function for such complex language variations.